﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>创建NetFramework插件项目</title>
	<script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
	<script type="text/javascript" src="../../Content/highlighter/scripts/shBrushJScript.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
	<link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css" />
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
	<script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>创建NetFramework插件项目</h3>
	<p>
		1.创建.net framework 4.0+类库项目
		2.使用nuget安装NFinal2
	</p>
	<h3>如何开发？</h3>
	<p>
		1.创建基础控制器
		<pre class="brush:csharp;">
        public class BaseController:NFinal.OwinAction&lt;NFinal.User.User>
        {
        }
        </pre>
		2.创建自定义控制器
		<pre class="brush:csharp;">
        public class IndexController:BaseController
        {
            public void Index()
            {
                Write("Hello World!");
            }
        }
        </pre>
		3.创建cshtml视图，该RazorView泛型参数为控制器实体类。该实体类位于IndexController.cs下。
		<pre class="brush:csharp;">
            @inherits NFinal.View.RazorView&lt;NFinalCorePlug.Controllers.IndexController_Model.Default>
        </pre>
	</p>
	<p>
		在宿主项目或Web项目的输出目录下的Plugs目录下新建该插件目录。并创建nfinal.json目录。
	</p>
</body>
</html>